package com.wanxi.tool.api;


import com.wanxi.tool.domain.ImgUpload;
import com.wanxi.tool.domain.result.ToolResult;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;


/**
 * @Author:Iny
 * @Data：2022/1/11 14:26
 */
@FeignClient(value = "tool",path = "/back/tool")
public interface ToolFeign {

    @ApiOperation(value="图片上传接口")
    @ApiImplicitParam(name = "file",value = "图片文件",dataType = "MultipartFile",required = true)
    @PostMapping("/uploadImg")
    ToolResult<ImgUpload> uploadImg(@RequestParam("file") MultipartFile file, @RequestParam("req") HttpServletRequest req);

    @ApiOperation(value="邮件发送接口")
    @ApiImplicitParam(name = "email",value = "需要接收验证码的邮箱",dataType = "String",required = true)
    @GetMapping("/getCodeByEmail")
    ToolResult<String> getEmail(@RequestParam("email") String email);

    @ApiOperation(value="根据邮箱过去验证码")
    @ApiImplicitParam(name = "email",value = "需要查找验证码的邮箱",dataType = "String",required = true)
    @GetMapping("/getCode")
    ToolResult<String> getCode(@RequestParam("email") String email);
}
